<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="keywords" content="">
<script src="../lib/vue.min.js"></script>
</head>
<body>
    <div id="box">
        <input type="text" v-model="mytext"/>
        <!-- <input type="text" @input="handleInput" /> -->

        <ul>
            <li v-for="data in getMyDatalist">
                {{data}}
            </li>
        </ul>
    </div>

    <script type="text/javascript">
        //["aaa","bbb","ccc","ddd","add","cee","eee"]        
       var vm = new Vue({
           el:"#box",
           data:{
                mytext:'',
               datalist:["aaa","bbb","ccc","ddd","add","cee","eee"]
           },
           computed: {
            getMyDatalist(){
                return this.datalist.filter(item=>item.indexOf(this.mytext)>-1)
            }
           },
       })

       var arr = [1,2,3,4,5]

       var newlist =arr.filter(item=>item>=3)
       console.log(newlist)
    </script>

</body>
</html>

